<?php if($search):?>
<h2>查询货主(发货人)信息</h2>
<?php else:?>
<h2>修改货主(发货人)信息</h2>
<?php endif;?>
<?php echo CHtml::beginForm(array($search?'search':'admin'),'post');?>
<table  style="margin: 0 auto;"  width="1070">
<tr><td>
	货主名称：<input type="text" name="keys[name]" size="5" value="<?php echo isset($_GET['keys']['name'])?$_GET['keys']['name']:'';?>"/>
	模糊查询：<input type="radio" name="keys[blur]" value="1" checked/>是  
	<input type="radio" name="keys[blur]" value="0" <?php echo isset($_GET['keys']['blur'])&&$_GET['keys']['blur']==0?'checked':'';?>/>否 
	<input type="submit" value="搜索"/>
</td></tr></table>
<?php echo CHtml::endForm();?>
<table width="1070px" class="dataGrid">
  <thead>
  <tr>
    <th width="80"><?php echo $sort->link('name'); ?></th>
    <th width="80"><?php echo $sort->link('legal_person_name'); ?></th>
    <th width="100"><?php echo $sort->link('office_tel'); ?></th>
    <th width="100"><?php echo $sort->link('office_fax'); ?></th>
    <th width="150"><?php echo $sort->link('registered_address'); ?></th>
    <th width="80"><?php echo $sort->link('registered_capital'); ?></th>
    <th width="100"><?php echo $sort->link('nature'); ?></th>
    <th width="80"><?php echo $sort->link('storage_manager'); ?></th>
    <th width="70"><?php echo $sort->link('dispatcher'); ?></th>
    <th width="70"><?php echo $sort->link('reckoner'); ?></th>
    <th width="80"><?php echo $sort->link('term'); ?></th>
	<?php if(!$search):?><th width="80">操作</th><?php endif ?>
  </tr>
  </thead>
  <tbody>
<?php foreach($models as $n=>$model): ?>
  <tr class="<?php echo $n%2?'even':'odd';?>">
    <?php 
    	$url=array('show','id'=>$model->id)+$_GET;//把所有参数包括页码、查询参数传入显示信息页面
    	$url['ret']=$search?'search':'admin';
    ?>
   	<td><?php echo CHtml::link($model->name,$url); ?></td>
    <td><?php echo CHtml::encode($model->legal_person_name); ?></td>
    <td><?php echo CHtml::encode($model->office_tel); ?></td>
    <td><?php echo CHtml::encode($model->office_fax); ?></td>
    <td><?php echo CHtml::encode($model->registered_address); ?></td>
    <td><?php echo CHtml::encode($model->registered_capital); ?></td>
    <td><?php echo CHtml::encode($model->nature); ?></td>
    <td><?php echo CHtml::encode($model->storage_manager); ?></td>
    <td><?php echo CHtml::encode($model->dispatcher); ?></td>
    <td><?php echo CHtml::encode($model->reckoner); ?></td>
    <td><?php echo CHtml::encode($model->term); ?></td>
     <?php if(!$search):?>
    <td>
      <?php echo CHtml::link('修改',array('update','id'=>$model->id)+$_GET); ?>
     <?php echo CHtml::link('删除',array('delete','id'=>$model->id)+$_GET,array('confirm'=>"确定要删除{$model->name}的货主(发货人)信息吗？")); ?>
	</td>
	<?php endif ?>
  </tr>
<?php endforeach; ?>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages,'htmlOptions'=>array('style'=>'width:1070px;'))); ?>
